mirror of
https://github.com/switchbrew/switch-tools.git
synced 2025-08-10 18:39:23 +02:00
nxlink: send server flag to the client.
Lets the client know beforehand if stdout/stderr redirection via nxlink should be initialized.
This commit is contained in:
parent
6f1d635208
commit
5ac1c4b253
10
src/nxlink.c
10
src/nxlink.c
@ -270,7 +270,7 @@ static unsigned char in[ZLIB_CHUNK];
|
||||
static unsigned char out[ZLIB_CHUNK];
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
static int sendNROFile(in_addr_t nxaddr, char *name, size_t filesize, FILE *fh) {
|
||||
static int sendNROFile(in_addr_t nxaddr, char *name, size_t filesize, FILE *fh, int server) {
|
||||
//---------------------------------------------------------------------------------
|
||||
|
||||
int retval = 0;
|
||||
@ -307,6 +307,12 @@ static int sendNROFile(in_addr_t nxaddr, char *name, size_t filesize, FILE *fh)
|
||||
|
||||
int namelen = strlen(name);
|
||||
|
||||
if (sendInt32LE(sock,server)) {
|
||||
fprintf(stderr,"Failed sending server flag\n");
|
||||
retval = -1;
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (sendInt32LE(sock,namelen)) {
|
||||
fprintf(stderr,"Failed sending filename length\n");
|
||||
retval = -1;
|
||||
@ -641,7 +647,7 @@ int main(int argc, char **argv) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
int res = sendNROFile(nxaddr.s_addr,finalpath,filesize,fh);
|
||||
int res = sendNROFile(nxaddr.s_addr,finalpath,filesize,fh,server);
|
||||
|
||||
fclose(fh);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user