Commit 400cc160a2dfe7eea0b923cf8048ce2a1eeb4c51

Authored by Perry Werneck
1 parent aa4812b8
Exists in master and in 1 other branch develop

Adding new method to ipc client objects.

client/src/include/lib3270/ipc.h
@@ -635,7 +635,6 @@ @@ -635,7 +635,6 @@
635 Host & push(unsigned short row, unsigned short col, const std::string &text); 635 Host & push(unsigned short row, unsigned short col, const std::string &text);
636 Host & push(const std::string &text); 636 Host & push(const std::string &text);
637 637
638 - Host & push(const char *text);  
639 Host & push(int baddr, const char *str, int len = -1); 638 Host & push(int baddr, const char *str, int len = -1);
640 Host & push(unsigned short row, unsigned short col, const char *str, int len = -1); 639 Host & push(unsigned short row, unsigned short col, const char *str, int len = -1);
641 Host & push(const char *str, int len = -1); 640 Host & push(const char *str, int len = -1);
client/src/session/local/set.cc
@@ -44,14 +44,17 @@ @@ -44,14 +44,17 @@
44 44
45 void Local::Session::set(const std::string &str) { 45 void Local::Session::set(const std::string &str) {
46 46
47 - std::lock_guard<std::mutex> lock(const_cast<Local::Session *>(this)->sync);  
48 - chkResponse(lib3270_input_string(hSession,(unsigned char *) str.c_str(),str.length())); 47 + std::lock_guard<std::mutex> lock(this->sync);
  48 +
  49 + int rc = lib3270_set_field(hSession,str.c_str(),str.length());
  50 + if(rc < 0)
  51 + chkResponse(-rc);
49 52
50 } 53 }
51 54
52 void Local::Session::set(int baddr, const std::string &str) { 55 void Local::Session::set(int baddr, const std::string &str) {
53 56
54 - std::lock_guard<std::mutex> lock(const_cast<Local::Session *>(this)->sync); 57 + std::lock_guard<std::mutex> lock(this->sync);
55 58
56 int rc = lib3270_set_string_at_address(hSession,baddr,(unsigned char *) str.c_str(),str.length()); 59 int rc = lib3270_set_string_at_address(hSession,baddr,(unsigned char *) str.c_str(),str.length());
57 if(rc < 0) 60 if(rc < 0)
@@ -61,7 +64,7 @@ @@ -61,7 +64,7 @@
61 64
62 void Local::Session::set(int row, int col, const std::string &str) { 65 void Local::Session::set(int row, int col, const std::string &str) {
63 66
64 - std::lock_guard<std::mutex> lock(const_cast<Local::Session *>(this)->sync); 67 + std::lock_guard<std::mutex> lock(this->sync);
65 68
66 int rc = lib3270_set_string_at(hSession,row,col,(unsigned char *) str.c_str(),str.length()); 69 int rc = lib3270_set_string_at(hSession,row,col,(unsigned char *) str.c_str(),str.length());
67 if(rc < 0) 70 if(rc < 0)
client/src/session/remote/set.cc
@@ -46,7 +46,7 @@ @@ -46,7 +46,7 @@
46 46
47 int rc; 47 int rc;
48 48
49 - Request(*this,"setString") 49 + Request(*this,"setField")
50 .push(str.c_str()) 50 .push(str.c_str())
51 .call() 51 .call()
52 .pop(rc); 52 .pop(rc);