return EINVAL;
}
-#define AFSV_BUFFERSIZE 16384
-
static struct afs_buffer {
struct afs_buffer *next;
} *freeBufferList = 0;
afs_buffersAlloced++;
if (!freeBufferList) {
FS_UNLOCK
- return malloc(AFSV_BUFFERSIZE);
+ return malloc(sendBufSize);
}
tp = freeBufferList;
freeBufferList = tp->next;
ihP = targetptr->handle;
fdP = IH_OPEN(ihP);
if (fdP == NULL) return EIO;
- optSize = AFSV_BUFFERSIZE;
+ optSize = sendBufSize;
tlen = FDH_SIZE(fdP);
if (tlen < 0) {
FDH_CLOSE(fdP);
TM_GetTimeOfDay(&StartTime, 0);
- optSize = AFSV_BUFFERSIZE;
+ optSize = sendBufSize;
/* truncate the file iff it needs it (ftruncate is slow even when its a noop) */
if (FileLength < DataLength) FDH_TRUNC(fdP, FileLength);
unsigned short spare; /* make it a multiple of 32 bits. */
} *CB; /* Don't use CB[0] */
-/* status bits for status field of CallBack structure */
+/* status values for status field of CallBack structure */
#define CB_NORMAL 1 /* Normal call back */
#define CB_DELAYED 2 /* Delayed call back due to rpc problems.
The call back entry will be added back to the
int novbc = 0; /* Enable Volume Break calls */
int busy_threshold = 600;
int udpBufSize = 0; /* UDP buffer size for receive*/
+int sendBufSize = 16384; /* send buffer size */
struct timeval tp;
strcat(buffer, "[-k <stack size>] ");
strcat(buffer, "[-realm <Kerberos realm name>] ");
strcat(buffer, "[-udpsize <size of socket buffer in bytes>] ");
+ strcat(buffer, "[-sendsize <size of send buffer in bytes>] ");
/* strcat(buffer, "[-enable_peer_stats] "); */
/* strcat(buffer, "[-enable_process_stats] "); */
strcat(buffer, "[-help]\n");
udpBufSize = bufSize;
}
else
+ if ( !strcmp(argv[i], "-sendsize")) {
+ if ( (i+1) >= argc ) {
+ printf("You have to specify -sendsize <integer value>\n");
+ return -1;
+ }
+ bufSize = atoi(argv[++i]);
+ if ( bufSize < 16384 )
+ printf("Warning:sendsize %d is less than minimum %d; ignoring\n",
+ bufSize, 16384);
+ else
+ sendBufSize = bufSize;
+ }
+ else
if (!strcmp(argv[i], "-enable_peer_stats")) {
rx_enablePeerRPCStats();
}