File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,16 +7,18 @@ CROSS_COMPILE ?= m68k-xelf-
77CC = $(CROSS_COMPILE ) gcc
88LD = $(CC )
99
10- CFLAGS = -Wall -O2 -g $(INC )
10+ CFLAGS = -Wall -O2 -g $(INC ) $( DEFS )
1111LDFLAGS = $(LIBS )
1212LIBS = -lsocket
1313
1414AXTLS_DIR = axtls
1515AXTLS_INCLUDE = axtls-include
1616
17- INC += -I. -I$(AXTLS_INCLUDE ) -I$(AXTLS_DIR ) /ssl -I$(AXTLS_DIR ) /crypto
17+ INC += -I. -I$(AXTLS_INCLUDE ) -I$(AXTLS_DIR ) /ssl -I$(AXTLS_DIR ) /crypto -Iiconv
18+ DEFS += -DICONV_ONLY_U2S
1819
19- SRCS += httpsget.c
20+ SRCS += httpsget.c \
21+ iconv/iconv_mini.c
2022
2123SRCS += $(addprefix $(AXTLS_DIR ) /, \
2224 ssl/asn1.c \
Original file line number Diff line number Diff line change 99#include <errno.h>
1010#include <ctype.h>
1111#include "ssl.h"
12+ #include "iconv/iconv_mini.h"
1213
1314char request [65536 ];
1415char response [65536 ];
1516char buffer [4096 ];
17+ char obuffer [4096 ];
1618
1719int main (int argc , char * * argv )
1820{
@@ -127,7 +129,12 @@ int main(int argc, char **argv)
127129 break ;
128130 }
129131// printf("Received %d bytes\n", res);
130- write (1 , ptr , res );
132+ uint8_t * p = ptr ;
133+ size_t len = res ;
134+ uint8_t * op = (uint8_t * )obuffer ;
135+ size_t olen = sizeof (obuffer );
136+ iconv_u2s ((char * * )& p , & len , (char * * )& op , & olen );
137+ fwrite (obuffer , 1 , sizeof (obuffer ) - olen , stdout );
131138 }
132139
133140 ssl_free (ssl_sock );
You can’t perform that action at this time.
0 commit comments