platform_system_core/adb
Spencer Low f055c193b8 adb: Win32: set socket buffer sizes properly
On Windows, adb_socket_setbufsize() was taking a file descriptor value
from the compatibility layer in sysdeps_win32.c (namely, an index into
the _win32_fhs array) and passing it to the Winsock setsockopt() call,
which wants a Winsock SOCKET handle. Basically, adb_socket_setbufsize()
was passing `fd` instead of `_fh_from_int(fd)->fh_socket`, resulting in
adb effectively setting a socket buffer size on a random socket in the
process.

The fix is to introduce adb_setsockopt() which just calls setsockopt()
on non-Win32, and which uses the Winsock SOCKET handle on Win32. The
change also moves Win32 disable_tcp_nagle() to a header and adds an
extra sanity check to adb_shutdown().

Change-Id: I4354e818d27538f7ff5b0e70b28bdb6300e1b98b
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-01-26 21:56:26 -08:00
..
tests Python unit test for adb. 2015-01-13 15:08:56 -08:00
adb.c system/core: Remove AID_GRAPHICS from adb groups 2014-11-21 18:08:05 -08:00
adb.h Begin moving code from adb to libadb. 2015-01-26 16:45:34 -08:00
adb_auth.h Introduce "adb keygen" 2014-12-08 13:44:39 -08:00
adb_auth_client.c fix for adbd pinning CPU 2014-09-25 21:51:15 -07:00
adb_auth_host.c Fix adb/fastboot windows compilations. 2014-12-09 16:03:29 -08:00
adb_client.c Add more debug information. 2014-12-09 16:08:24 -08:00
adb_client.h Support adb client connect to remote server 2013-01-04 11:00:38 -08:00
adb_trace.h Add more debug information. 2014-12-09 16:08:24 -08:00
Android.mk Merge "Fix userdebug build." 2015-01-27 01:30:24 +00:00
commandline.c adb: Win32: set socket buffer sizes properly 2015-01-26 21:56:26 -08:00
console.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
fdevent.cpp Begin moving code from adb to libadb. 2015-01-26 16:45:34 -08:00
fdevent.h Begin moving code from adb to libadb. 2015-01-26 16:45:34 -08:00
file_sync_client.c Clean up adb Win32 symlink #ifdefs. 2015-01-12 17:00:09 -08:00
file_sync_service.c Clean up adb Win32 symlink #ifdefs. 2015-01-12 17:00:09 -08:00
file_sync_service.h Kill HAVE_BIG_ENDIAN, HAVE_ENDIAN_H, and HAVE_LITTLE_ENDIAN. 2014-11-21 23:10:45 -08:00
framebuffer_service.c Merge "Fix deadlocks." 2014-12-03 18:38:05 +00:00
get_my_path_darwin.c Remove explict use of ASCII encoding 2014-11-21 15:56:59 +00:00
get_my_path_freebsd.c FreeBSD support for usb-connected devices in adb 2009-10-25 01:56:35 +11:00
get_my_path_linux.c Make get_my_path() safer 2009-10-22 02:55:00 +11:00
get_my_path_windows.c Make get_my_path() safer 2009-10-22 02:55:00 +11:00
jdwp_service.c Add more debug information. 2014-12-09 16:08:24 -08:00
MODULE_LICENSE_APACHE2 eclair snapshot 2009-11-12 18:46:23 -08:00
mutex_list.h adb: Cleanup dead code 2013-04-24 21:31:45 -07:00
NOTICE eclair snapshot 2009-11-12 18:46:23 -08:00
OVERVIEW.TXT Fixing spelling errors in adb docs 2010-04-28 11:38:39 -04:00
protocol.txt adb: Add public key authentification 2012-08-23 00:20:06 -07:00
remount_service.c Merge "Use getmntent when accessing /proc/mounts." 2015-01-06 17:41:40 +00:00
services.c adbd: tcpip command uses port number from uninitialized memory 2015-01-25 17:38:36 -08:00
SERVICES.TXT adb: implement "adb reverse <local> <remote>" 2014-05-27 16:42:13 +02:00
set_verity_enable_state_service.c Protect from eng vs userdebug build breaks. 2015-01-26 17:49:17 -08:00
sockets.c adbd: adb root should terminate adbd only if it's debuggable 2014-05-05 17:20:00 +08:00
sockets.dia auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
SYNC.TXT Adding documentation on the sync part of the adb protocol previously missing. 2014-03-20 20:36:46 +01:00
sysdeps.h adb: Win32: set socket buffer sizes properly 2015-01-26 21:56:26 -08:00
sysdeps_win32.c adb: Win32: set socket buffer sizes properly 2015-01-26 21:56:26 -08:00
test_track_devices.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
test_track_jdwp.c auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
transport.c Add more debug information. 2014-12-09 16:08:24 -08:00
transport.h Begin moving code from adb to libadb. 2015-01-26 16:45:34 -08:00
transport_local.c Kill HAVE_BIG_ENDIAN, HAVE_ENDIAN_H, and HAVE_LITTLE_ENDIAN. 2014-11-21 23:10:45 -08:00
transport_usb.c Kill HAVE_BIG_ENDIAN, HAVE_ENDIAN_H, and HAVE_LITTLE_ENDIAN. 2014-11-21 23:10:45 -08:00
usb_libusb.c adb: Add ability to specify device path 2012-04-20 11:21:14 -07:00
usb_linux.c Merge "ADB on linux: Handle USB SuperSpeed extra Descriptors" 2014-12-08 22:35:41 +00:00
usb_linux_client.c Fix the v2 descriptor handling. 2015-01-26 12:50:35 -08:00
usb_osx.c Disable vendor id filtering for OS X. 2014-11-21 14:14:58 +00:00
usb_windows.c Fix adb/fastboot windows compilations. 2014-12-09 16:03:29 -08:00