export go_read_post
(threadIndex C.uintptr_t, cBuf *C.char, countBytes C.size_t)
| 633 | |
| 634 | //export go_read_post |
| 635 | func go_read_post(threadIndex C.uintptr_t, cBuf *C.char, countBytes C.size_t) (readBytes C.size_t) { |
| 636 | fc := phpThreads[threadIndex].frankenPHPContext() |
| 637 | |
| 638 | if fc.responseWriter == nil { |
| 639 | return 0 |
| 640 | } |
| 641 | |
| 642 | p := unsafe.Slice((*byte)(unsafe.Pointer(cBuf)), countBytes) |
| 643 | var err error |
| 644 | for readBytes < countBytes && err == nil { |
| 645 | var n int |
| 646 | n, err = fc.request.Body.Read(p[readBytes:]) |
| 647 | readBytes += C.size_t(n) |
| 648 | } |
| 649 | |
| 650 | return |
| 651 | } |
| 652 | |
| 653 | //export go_read_cookies |
| 654 | func go_read_cookies(threadIndex C.uintptr_t) *C.char { |
nothing calls this directly
no test coverage detected