Lines Matching defs:data

31  * 2. Get commands on STDIN. Pass data on to the TCP stream.
32 * Get data from TCP stream and pass on to STDOUT.
352 char data[120];
355 char *optr = data;
357 int left = sizeof(data);
383 logmsg("'%s'", data);
385 optr = data;
386 left = sizeof(data);
390 logmsg("'%s'", data);
396 * *buffer_len is the amount of data in the buffer (output)
408 logmsg("ERROR: Buffer size (%zd bytes) too small for data size "
412 logmsg("> %zd bytes data, server => client", *buffer_len);
448 struct select_ws_wait_data *data;
455 data = (struct select_ws_wait_data *) lpParameter;
456 if(data) {
457 handle = data->handle;
458 handles[0] = data->abort;
460 signal = data->signal;
461 free(data);
500 /* there is some data available, stop waiting */
501 logmsg("[select_ws_wait_thread] data available, DISK: %p", handle);
529 /* there is some data available, stop waiting */
530 logmsg("[select_ws_wait_thread] data available, CHAR: %p", handle);
538 * - peek into the pipe and retrieve the amount of data available.
541 * or there is data in the pipe available for reading.
545 /* peek into the pipe and retrieve the amount of data available */
548 /* if there is no data available, sleep and continue waiting */
569 /* there is some data available, stop waiting */
570 logmsg("[select_ws_wait_thread] data available, PIPE: %p", handle);
579 logmsg("[select_ws_wait_thread] data available, HANDLE: %p", handle);
594 struct select_ws_wait_data *data;
597 /* allocate internal waiting data structure */
598 data = malloc(sizeof(struct select_ws_wait_data));
599 if(data) {
600 data->handle = handle;
601 data->signal = signal;
602 data->abort = abort;
606 thread = CreateThread(NULL, 0, &select_ws_wait_thread, data, 0, NULL);
608 thread = _beginthreadex(NULL, 0, &select_ws_wait_thread, data, 0, NULL);
611 /* free data if thread failed to launch */
613 free(data);
633 struct select_ws_data *data;
666 /* allocate internal array for the internal data */
667 data = calloc(nfds, sizeof(struct select_ws_data));
668 if(!data) {
678 free(data);
713 data[nfd].fd = fd;
721 data[nth].signal = signal;
722 data[nth].thread = handle;
748 data[nws].wsasock = wsasock;
749 data[nws].wsaevent = wsaevent;
750 data[nfd].wsastate = 0;
758 data[nfd].wsastate |= FD_READ;
760 data[nfd].wsastate |= FD_WRITE;
762 data[nfd].wsastate |= FD_OOB;
775 data[nth].signal = signal;
776 data[nth].thread = handle;
806 WaitForSingleObjectEx(data[i].thread, INFINITE, FALSE);
807 CloseHandle(data[i].thread);
813 fd = data[i].fd;
837 wsaevents.lNetworkEvents |= data[i].wsastate;
877 WSAEventSelect(data[i].wsasock, NULL, 0);
878 WSACloseEvent(data[i].wsaevent);
882 CloseHandle(data[i].signal);
887 free(data);
923 /* We must read more data to stay in sync */
927 logmsg("Throwing again %zd data bytes", buffer_len);
971 char data[16];
1072 /* read from stdin, commands/data to be dealt with and possibly passed on
1079 4-digit hexadecimal data length + LF [if the command takes data]
1080 data [the data being as long as set above]
1084 DATA - plain pass-through data
1104 msnprintf(data, sizeof(data), "PORT\n%04zx\n", buffer_len);
1105 if(!write_stdout(data, 10))
1116 /* data IN => data OUT */
1129 logmsg("Not all data was sent. Bytes to send: %zd sent: %zd",
1175 /* read from socket, pass on data to stdout */
1179 msnprintf(data, sizeof(data), "DATA\n%04zx\n", nread_socket);
1180 if(!write_stdout(data, 10))
1185 logmsg("< %zd bytes data, client => server", nread_socket);