Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: net/base/net_util.cc

Issue 9260: Change made by external contributor Ibrar Ahmed (ibrar.ahmad@gmail.com), revi... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/base/net_util.h ('k') | net/base/telnet_server.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <algorithm> 5 #include <algorithm>
6 #include <unicode/ucnv.h> 6 #include <unicode/ucnv.h>
7 #include <unicode/uidna.h> 7 #include <unicode/uidna.h>
8 #include <unicode/ulocdata.h> 8 #include <unicode/ulocdata.h>
9 #include <unicode/uniset.h> 9 #include <unicode/uniset.h>
10 #include <unicode/uscript.h> 10 #include <unicode/uscript.h>
11 #include <unicode/uset.h> 11 #include <unicode/uset.h>
12 12
13 #ifdef OS_WIN 13 #include "build/build_config.h"
14
15 #if defined(OS_WIN)
14 #include <windows.h> 16 #include <windows.h>
17 #include <winsock2.h>
18 #elif defined(OS_POSIX)
19 #include <sys/socket.h>
20 #include <fcntl.h>
15 #endif 21 #endif
16 22
17 #include "net/base/net_util.h" 23 #include "net/base/net_util.h"
18 24
19 #include "base/basictypes.h" 25 #include "base/basictypes.h"
20 #include "base/file_util.h" 26 #include "base/file_util.h"
21 #include "base/logging.h" 27 #include "base/logging.h"
22 #include "base/path_service.h" 28 #include "base/path_service.h"
23 #include "base/scoped_ptr.h" 29 #include "base/scoped_ptr.h"
24 #include "base/string_escape.h" 30 #include "base/string_escape.h"
(...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 int array_size = arraysize(kAllowedFtpPorts); 914 int array_size = arraysize(kAllowedFtpPorts);
909 for (int i = 0; i < array_size; i++) { 915 for (int i = 0; i < array_size; i++) {
910 if (kAllowedFtpPorts[i] == port) { 916 if (kAllowedFtpPorts[i] == port) {
911 return true; 917 return true;
912 } 918 }
913 } 919 }
914 // Port not explicitly allowed by FTP, so return the default restrictions. 920 // Port not explicitly allowed by FTP, so return the default restrictions.
915 return IsPortAllowedByDefault(port); 921 return IsPortAllowedByDefault(port);
916 } 922 }
917 923
924 int SetNonBlocking(int fd) {
925 #if defined(OS_WIN)
926 unsigned long no_block = 1;
927 return ioctlsocket(fd, FIONBIO, &no_block);
928 #elif defined(OS_POSIX)
929 int flags = fcntl(fd, F_GETFL, 0);
930 if (-1 == flags)
931 flags = 0;
932 return fcntl(fd, F_SETFL, flags | O_NONBLOCK);
933 #endif
934 }
935
918 } // namespace net 936 } // namespace net
OLDNEW
« no previous file with comments | « net/base/net_util.h ('k') | net/base/telnet_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698