Commit 40d2d527e5671069fe97f776650ff9ac716bb3f1
1 parent
3712cc3b
Exists in
master
and in
5 other branches
Corrigindo chamadas IPC no windows
Showing
9 changed files
with
64 additions
and
18 deletions
Show diff stats
po/pt_BR.po
| ... | ... | @@ -5,7 +5,7 @@ msgid "" |
| 5 | 5 | msgstr "" |
| 6 | 6 | "Project-Id-Version: pw3270 5.0\n" |
| 7 | 7 | "Report-Msgid-Bugs-To: \n" |
| 8 | -"POT-Creation-Date: 2014-04-15 15:34-0300\n" | |
| 8 | +"POT-Creation-Date: 2014-04-16 07:31-0300\n" | |
| 9 | 9 | "PO-Revision-Date: 2014-02-17 08:05-0300\n" |
| 10 | 10 | "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n" |
| 11 | 11 | "Language-Team: Portugues <>\n" | ... | ... |
src/classlib/Makefile.in
| ... | ... | @@ -61,6 +61,8 @@ LIBS=@LIBS@ $(CLASS_LIBS) |
| 61 | 61 | |
| 62 | 62 | DEBUG_CFLAGS=-DDEBUG=1 -g -Wall |
| 63 | 63 | |
| 64 | +EXEEXT=@EXEEXT@ | |
| 65 | + | |
| 64 | 66 | #---[ Rules ]------------------------------------------------------------------ |
| 65 | 67 | |
| 66 | 68 | CXX=@CXX@ |
| ... | ... | @@ -103,7 +105,7 @@ run: $(BINDBG)/testprogram$(EXEEXT) |
| 103 | 105 | $(BINDBG)/testprogram$(EXEEXT): $(OBJDBG)/testprogram.o $(BINDBG)/$(LIBNAME) |
| 104 | 106 | @echo " CCLD `basename $@`" |
| 105 | 107 | @$(MKDIR) `dirname $@` |
| 106 | - @$(LD) -o $@ $^ $(LIBS) | |
| 108 | + @$(LD) -o $@ $^ | |
| 107 | 109 | |
| 108 | 110 | $(BINDBG)/$(LIBNAME): $(foreach SRC, $(basename $(CLASS_SRC)), $(OBJDBG)/$(SRC).o) |
| 109 | 111 | @echo " CCLD `basename $@`" | ... | ... |
src/classlib/remote.cc
| ... | ... | @@ -134,17 +134,21 @@ |
| 134 | 134 | struct hllapi_packet_text * response; |
| 135 | 135 | DWORD cbSize = sizeof(struct hllapi_packet_text)+len; |
| 136 | 136 | string s; |
| 137 | + char buffer[cbSize+2]; | |
| 137 | 138 | |
| 138 | - response = (struct hllapi_packet_text *) malloc(cbSize+2); | |
| 139 | - memset(response,0,cbSize+2); | |
| 139 | + response = (struct hllapi_packet_text *) buffer; | |
| 140 | 140 | |
| 141 | - if(TransactNamedPipe(hPipe,(LPVOID) query, szQuery, &response, cbSize, &cbSize,NULL)) | |
| 141 | + if(TransactNamedPipe(hPipe,(LPVOID) query, szQuery, response, cbSize, &cbSize,NULL)) | |
| 142 | 142 | { |
| 143 | - if(response->packet_id) | |
| 143 | + buffer[cbSize] = 0; | |
| 144 | + if(!response->packet_id) | |
| 144 | 145 | s.assign(response->text); |
| 145 | 146 | } |
| 146 | - | |
| 147 | - free(response); | |
| 147 | + else | |
| 148 | + { | |
| 149 | + trace("TransactNamedPipe error on call %d",(int) *( (unsigned char *) query)); | |
| 150 | + s.assign(""); | |
| 151 | + } | |
| 148 | 152 | |
| 149 | 153 | return s; |
| 150 | 154 | } |
| ... | ... | @@ -402,8 +406,6 @@ |
| 402 | 406 | char * str; |
| 403 | 407 | char * ptr; |
| 404 | 408 | time_t timer; |
| 405 | - WIN32_FIND_DATA FindFileData; | |
| 406 | - | |
| 407 | 409 | |
| 408 | 410 | hPipe = INVALID_HANDLE_VALUE; |
| 409 | 411 | |
| ... | ... | @@ -484,6 +486,22 @@ |
| 484 | 486 | |
| 485 | 487 | free(str); |
| 486 | 488 | |
| 489 | + trace("Searching for \"%s\"",buffer); | |
| 490 | + | |
| 491 | + hPipe = CreateFile(buffer,GENERIC_WRITE|GENERIC_READ,0,NULL,OPEN_EXISTING,0,NULL); | |
| 492 | + | |
| 493 | + if(hPipe == INVALID_HANDLE_VALUE) | |
| 494 | + { | |
| 495 | + timer = time(0)+20; | |
| 496 | + while(hPipe == INVALID_HANDLE_VALUE && time(0) < timer) | |
| 497 | + { | |
| 498 | + hPipe = CreateFile(buffer,GENERIC_WRITE|GENERIC_READ,0,NULL,OPEN_EXISTING,0,NULL); | |
| 499 | + Sleep(10); | |
| 500 | + } | |
| 501 | + } | |
| 502 | + /* | |
| 503 | + WIN32_FIND_DATA FindFileData; | |
| 504 | + | |
| 487 | 505 | timer = time(0)+20; |
| 488 | 506 | while(hPipe == INVALID_HANDLE_VALUE && time(0) < timer) |
| 489 | 507 | { |
| ... | ... | @@ -501,6 +519,7 @@ |
| 501 | 519 | throw exception(GetLastError(),"Timeout waiting for %s instance",PACKAGE_NAME); |
| 502 | 520 | return; |
| 503 | 521 | } |
| 522 | + */ | |
| 504 | 523 | |
| 505 | 524 | if(hPipe == INVALID_HANDLE_VALUE) |
| 506 | 525 | { |
| ... | ... | @@ -762,8 +781,8 @@ |
| 762 | 781 | |
| 763 | 782 | while(time(0) < end) |
| 764 | 783 | { |
| 765 | - if(!is_connected()) | |
| 766 | - return ENOTCONN; | |
| 784 | + //if(!is_connected()) | |
| 785 | + // return ENOTCONN; | |
| 767 | 786 | |
| 768 | 787 | if(is_ready()) |
| 769 | 788 | return 0; | ... | ... |
src/classlib/testprogram.cc
| ... | ... | @@ -61,6 +61,13 @@ |
| 61 | 61 | cout << "\tHost charset: " << s.c_str() << endl; |
| 62 | 62 | |
| 63 | 63 | session->connect(false); |
| 64 | + | |
| 65 | + cout << "\tWaitForReady: " << session->wait_for_ready(10) << endl; | |
| 66 | + | |
| 67 | + cout << "\tIsConnected: " << session->is_connected() << endl; | |
| 68 | + cout << "\tIsReady: " << session->is_ready() << endl; | |
| 69 | + cout << "\tString(3,2,14) " << session->get_string_at(3,2,14) << endl; | |
| 70 | + | |
| 64 | 71 | delete session; |
| 65 | 72 | } |
| 66 | 73 | ... | ... |
src/plugins/hllapi/calls.cc
| ... | ... | @@ -30,9 +30,7 @@ |
| 30 | 30 | #include <exception> |
| 31 | 31 | #include <pw3270/class.h> |
| 32 | 32 | #include <pw3270/hllapi.h> |
| 33 | - | |
| 34 | - #undef trace | |
| 35 | - #define trace( fmt, ... ) { FILE *out = fopen("c:\\Users\\Perry\\hllapi.log","a"); if(out) { fprintf(out, "%s(%d) " fmt "\n", __FILE__, __LINE__, __VA_ARGS__ ); fclose(out); } } | |
| 33 | + #include "client.h" | |
| 36 | 34 | |
| 37 | 35 | using namespace std; |
| 38 | 36 | using namespace PW3270_NAMESPACE; |
| ... | ... | @@ -52,9 +50,11 @@ |
| 52 | 50 | if(hSession) |
| 53 | 51 | delete hSession; |
| 54 | 52 | hSession = session::create(mode); |
| 53 | + trace("hSession=%p",hSession); | |
| 55 | 54 | } |
| 56 | 55 | catch(std::exception &e) |
| 57 | 56 | { |
| 57 | + trace("Error \"%s\"",e.what()); | |
| 58 | 58 | return HLLAPI_STATUS_SYSTEM_ERROR; |
| 59 | 59 | } |
| 60 | 60 | ... | ... |
src/plugins/hllapi/client.h
| ... | ... | @@ -38,6 +38,11 @@ |
| 38 | 38 | |
| 39 | 39 | #define set_active(x) /* x */ |
| 40 | 40 | |
| 41 | + #if defined(DEBUG) && defined(_WIN32) | |
| 42 | + #undef trace | |
| 43 | + #define trace( fmt, ... ) { FILE *out = fopen("c:\\Users\\Perry\\hllapi.log","a"); if(out) { fprintf(out, "%s(%d) " fmt "\n", __FILE__, __LINE__, __VA_ARGS__ ); fclose(out); } } | |
| 44 | + #endif // DEBUG | |
| 45 | + | |
| 41 | 46 | void * hllapi_pipe_init(const char *id); |
| 42 | 47 | void hllapi_pipe_deinit(void *h); |
| 43 | 48 | const char * hllapi_pipe_get_revision(void); | ... | ... |
src/plugins/hllapi/hllapi.c
| ... | ... | @@ -98,9 +98,14 @@ |
| 98 | 98 | for(f=0;f< (sizeof (hllapi_call) / sizeof ((hllapi_call)[0]));f++) |
| 99 | 99 | { |
| 100 | 100 | if(hllapi_call[f].func == *func) |
| 101 | - return hllapi_call[f].exec(buffer,length,rc); | |
| 101 | + { | |
| 102 | + int status = hllapi_call[f].exec(buffer,length,rc); | |
| 103 | + trace("hllapi(%d) exits with rc=%d",*func,status); | |
| 104 | + return status; | |
| 105 | + } | |
| 102 | 106 | } |
| 103 | 107 | |
| 108 | + trace("hllapi(%d) failed",*func); | |
| 104 | 109 | return invalid_request(buffer, length, rc); |
| 105 | 110 | } |
| 106 | 111 | ... | ... |
src/plugins/hllapi/pluginmain.c
| ... | ... | @@ -160,6 +160,12 @@ |
| 160 | 160 | pkt->packet_id = errno ? errno : -1; |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | + trace("szBlock=%d text=\"%s\"",szBlock, ( (struct hllapi_packet_text *) pkt)->text); | |
| 164 | + for(int f=0;f< (int) szBlock;f++) | |
| 165 | + { | |
| 166 | + trace("rsp(%d)= %d \"%s\"",f,* (((char *) pkt)+f),((char *) pkt)+f); | |
| 167 | + } | |
| 168 | + | |
| 163 | 169 | WriteFile(source->hPipe,pkt,szBlock,&szBlock,NULL); |
| 164 | 170 | |
| 165 | 171 | g_free(pkt); |
| ... | ... | @@ -352,6 +358,7 @@ |
| 352 | 358 | break; |
| 353 | 359 | |
| 354 | 360 | case HLLAPI_PACKET_GET_HOST_CHARSET: |
| 361 | + trace("%s","HLLAPI_PACKET_GET_HOST_CHARSET"); | |
| 355 | 362 | send_text(source,(char *) lib3270_get_host_charset(lib3270_get_default_session_handle())); |
| 356 | 363 | break; |
| 357 | 364 | ... | ... |
src/plugins/rx3270/Makefile.in
| ... | ... | @@ -47,6 +47,7 @@ LIBS=@REXX_LIBS@ @LIBICONV@ @DBUS_LIBS@ |
| 47 | 47 | CFLAGS=@REXX_CFLAGS@ @DBUS_CFLAGS@ |
| 48 | 48 | REXX_HOME=@REXX_HOME@ |
| 49 | 49 | REXXLIBDIR=@REXX_LIBDIR@ |
| 50 | +SYSDLL_FLAGS=@SYSDLL_FLAGS@ | |
| 50 | 51 | |
| 51 | 52 | #---[ Debug Targets ]---------------------------------------------------------- |
| 52 | 53 | |
| ... | ... | @@ -58,7 +59,7 @@ $(BINDBG)/$(PLUGIN_NAME): $(foreach SRC, $(basename $(PLUGIN_SRC)), $(OBJDBG)/$( |
| 58 | 59 | $(BINDBG)$(DLL_NAME).$(VERSION): $(foreach SRC, $(basename $(EXTAPI_SRC)), $(OBJDBG)/$(SRC)@OBJEXT@) $(CLASS_DEBUG_OBJECTS) |
| 59 | 60 | @echo " CCLD `basename $@`" |
| 60 | 61 | @$(MKDIR) `dirname $@` |
| 61 | - @$(CXX) $(DLL_FLAGS) $(LDFLAGS) @LDSOFLAGS@ @DBGRPATH@ -o $@ $^ $(LIBS) $(LIB3270_LIBS) $(CLASS_LIBS) | |
| 62 | + @$(CXX) $(SYSDLL_FLAGS) $(LDFLAGS) @LDSOFLAGS@ @DBGRPATH@ -o $@ $^ $(LIBS) $(LIB3270_LIBS) $(CLASS_LIBS) | |
| 62 | 63 | |
| 63 | 64 | #---[ Release Targets ]-------------------------------------------------------- |
| 64 | 65 | |
| ... | ... | @@ -70,7 +71,7 @@ $(BINRLS)/$(PLUGIN_NAME): $(foreach SRC, $(basename $(PLUGIN_SRC)), $(OBJRLS)/$( |
| 70 | 71 | $(BINRLS)$(DLL_NAME).$(VERSION): $(foreach SRC, $(basename $(EXTAPI_SRC)), $(OBJRLS)/$(SRC).o) $(CLASS_RELEASE_OBJECTS) |
| 71 | 72 | @echo " CCLD `basename $@`" |
| 72 | 73 | @$(MKDIR) `dirname $@` |
| 73 | - @$(CXX) $(DLL_FLAGS) @LDSOFLAGS@ $(LDFLAGS) @RLS_LDFLAGS@ -o $@ $^ $(LIBS) $(LIB3270_LIBS) $(CLASS_LIBS) | |
| 74 | + @$(CXX) $(SYSDLL_FLAGS) @LDSOFLAGS@ $(LDFLAGS) @RLS_LDFLAGS@ -o $@ $^ $(LIBS) $(LIB3270_LIBS) $(CLASS_LIBS) | |
| 74 | 75 | |
| 75 | 76 | install: |
| 76 | 77 | @$(MKDIR) $(DESTDIR)$(libdir)/$(PACKAGE_NAME)-plugin | ... | ... |