Commit 3966537f22d228c3a2c525403c484b114104c295
1 parent
47d5687c
Exists in
master
Implementando ajuste de timeout.
Showing
1 changed file
with
9 additions
and
2 deletions
Show diff stats
src/set.cc
... | ... | @@ -88,16 +88,23 @@ PHP_METHOD(tn3270, setstringat) |
88 | 88 | |
89 | 89 | PHP_METHOD(tn3270, __set) |
90 | 90 | { |
91 | - /* | |
92 | 91 | tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); |
93 | 92 | const char * name; |
94 | 93 | int szName; |
95 | 94 | const char * text; |
96 | 95 | int szText; |
96 | + string str; | |
97 | 97 | |
98 | 98 | if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &szName, &text, &szText) == FAILURE) |
99 | 99 | RETURN_NULL(); |
100 | - */ | |
100 | + | |
101 | + str = string(text,szText); | |
102 | + | |
103 | + if(!strncasecmp("timeout",text,szText)) { | |
104 | + obj->hSession->set_timeout(atoi(str.c_str())); | |
105 | + } else if(!strncasecmp("autoclose",text,szText)) { | |
106 | + obj->hSession->set_autoclose(atoi(str.c_str())); | |
107 | + } | |
101 | 108 | |
102 | 109 | RETURN_NULL(); |
103 | 110 | } | ... | ... |