[Python-checkins] CVS: python/dist/src/Modules socketmodule.c,1.200.6.2,1.200.6.3

Michael Hudson mwh@users.sourceforge.net
Mon, 25 Mar 2002 09:40:45 -0800


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv32611

Modified Files:
      Tag: release22-maint
	socketmodule.c 
Log Message:
backport jackjansen's checkin of
    revision 1.211 of socketmodule.c

Due to interaction between the MSL C library and the GUSI I/O library I can get reads from sockets to work consistently either for unbuffered binary files or for buffered binary files, but not for both:-(

The workaround is to force socket.makefile() to disable buffering for binary files.

Fixes bug 534625. 2.2.1 candidate.


Index: socketmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v
retrieving revision 1.200.6.2
retrieving revision 1.200.6.3
diff -C2 -d -r1.200.6.2 -r1.200.6.3
*** socketmodule.c	12 Jan 2002 11:13:23 -0000	1.200.6.2
--- socketmodule.c	25 Mar 2002 17:40:43 -0000	1.200.6.3
***************
*** 1454,1457 ****
--- 1454,1462 ----
  		return PySocket_Err();
  	}
+ #ifdef USE_GUSI2
+ 	/* Workaround for bug in Metrowerks MSL vs. GUSI I/O library */
+ 	if (strchr(mode, 'b') != NULL )
+ 		bufsize = 0;
+ #endif
  	f = PyFile_FromFile(fp, "<socket>", mode, fclose);
  	if (f != NULL)