Skip to content

Commit

Permalink
TCP: lifted restriction to process only text data, now transfer of bi…
Browse files Browse the repository at this point in the history
…nary data are also possible

RXMVS: added some documentation for the options command
  • Loading branch information
Peter-Jacob committed May 10, 2024
1 parent 96e4313 commit c9c4b9c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
9 changes: 8 additions & 1 deletion src/rxmvs.c
Original file line number Diff line number Diff line change
Expand Up @@ -6499,7 +6499,14 @@ void R_options( int func ) {
LASCIIZ(*ARG2);
Lupper(ARG1);
Lupper(ARG2);

/* OPTIONS STEMCLEAR assigned to brxoptions[0]
* STECLEAR ON : if a default value is set (stem.=xx) all existing entries are renamed to this value
* STECLEAR OFF: existing entries keep their content
* OPTIONS DATE assigned to brxoptions[1]
* assigns a default output option to all date functions.
* allowed values are XEUROPEAN,EUROPEAN, XUSA, USA, XGERMAN, GERMAN
* DATE default-output-date
*/
if (strncmp((const char *) ARG1->pstr, "STEMCLEAR",4)==0 ) {
if (strcmp((const char *) ARG2->pstr, "OFF") == 0) brxoptions[0]='1';
else if (strcmp((const char *) ARG2->pstr, "ON") == 0) brxoptions[0]='0';
Expand Down
10 changes: 6 additions & 4 deletions src/rxtcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#define SELECT_TIMEOUT 2
#define MAX_CLIENTS 256
#define BUFFER_SIZE 4096
#define BUFFER_SIZE 8192

SOCKET server_socket;
SOCKET client_sockets[MAX_CLIENTS];
Expand Down Expand Up @@ -395,9 +395,11 @@ void R_tcpsend(__unused int func) {
timeoutValue.tv_usec = 0;

bzero(buffer, BUFFER_SIZE);
strncpy (buffer, (char *) LSTR(*ARG2), MIN(BUFFER_SIZE, LLEN(*ARG2)));
// strncpy (buffer, (char *) LSTR(*ARG2), MIN(BUFFER_SIZE, LLEN(*ARG2)));
remaining=MIN(BUFFER_SIZE, LLEN(*ARG2));
memcpy(buffer,(char *) LSTR(*ARG2), remaining);
// remaining = strlen(buffer);

remaining = strlen(buffer);

ENABLE_NBIO(client_socket) // in __CROSS__ only

Expand Down Expand Up @@ -496,7 +498,7 @@ void R_tcprecv(__unused int func) {
}
}

setVariable("_DATA", buffer);
setVariable2("_DATA", buffer,result);

DISBLE_NBIO(client_socket)
}
Expand Down

0 comments on commit c9c4b9c

Please sign in to comment.