Lines 151-157
do_http_request() {
Link Here
|
151 |
if [ -n "${body}" ]; then txt="${txt}${CR}${NL}Content-Length: ${#body}"; fi |
151 |
if [ -n "${body}" ]; then txt="${txt}${CR}${NL}Content-Length: ${#body}"; fi |
152 |
txt="${txt}${CR}${NL}${CR}${NL}${body}" |
152 |
txt="${txt}${CR}${NL}${CR}${NL}${body}" |
153 |
|
153 |
|
154 |
resp=$(echo "${txt}" | nlog "out" | ${NC} ${nc_host} ${nc_port} | nlog "in" 2>/dev/null) |
154 |
resp=$(echo "${txt}" | nlog "out" | ${NC} -w ${timeout} ${nc_host} ${nc_port} | nlog "in" 2>/dev/null) |
155 |
if [ $? -ne 0 ]; then |
155 |
if [ $? -ne 0 ]; then |
156 |
if [ ${do_log} -ne 0 ]; then |
156 |
if [ ${do_log} -ne 0 ]; then |
157 |
log "FAIL" "Failed to send data to the host ${nc_host}:${nc_port}, is network or host down?" |
157 |
log "FAIL" "Failed to send data to the host ${nc_host}:${nc_port}, is network or host down?" |
158 |
- |
|
|