Skip to content

Commit

Permalink
Merge pull request #4 from gordonchiang/feature-Enable_sending_body_w…
Browse files Browse the repository at this point in the history
…ith_request

Feature: Enable returning streamId when sending a request with additional body data
  • Loading branch information
kachayev committed Apr 27, 2022
2 parents bdaf571 + b1aaf89 commit ea5effc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public final static Http3Connection withTransport(Connection conn, Http3Config c
/**
* @see sendRequest(Http3Header[], boolean)
*/
public final void sendRequest(List<Http3Header> headers, boolean fin) {
sendRequest(headers.toArray(new Http3Header[0]), fin);
public final long sendRequest(List<Http3Header> headers, boolean fin) {
return sendRequest(headers.toArray(new Http3Header[0]), fin);
}

/**
Expand All @@ -58,8 +58,8 @@ public final void sendRequest(List<Http3Header> headers, boolean fin) {
* happens the application should retry the operation once the stream is reported
* as writable again.
*/
public final void sendRequest(Http3Header[] headers, boolean fin) {
Http3Native.quiche_h3_send_request(getPointer(), conn.getPointer(), headers, fin);
public final long sendRequest(Http3Header[] headers, boolean fin) {
return Http3Native.quiche_h3_send_request(getPointer(), conn.getPointer(), headers, fin);
}

/**
Expand Down
3 changes: 2 additions & 1 deletion quiche4j-jni/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -819,11 +819,12 @@ pub extern "system" fn Java_io_quiche4j_http3_Http3Native_quiche_1h3_1send_1requ
h3_ptr: jlong,
conn_ptr: jlong,
headers: jobjectArray,
fin: jboolean,
) {
let h3_conn = unsafe { &mut *(h3_ptr as *mut h3::Connection) };
let mut conn = unsafe { &mut *(conn_ptr as *mut Connection) };
let req = headers_from_java(&env, headers).unwrap();
h3_conn.send_request(&mut conn, &req, true).unwrap();
h3_conn.send_request(&mut conn, &req, fin != 0).unwrap();
}

#[no_mangle]
Expand Down

0 comments on commit ea5effc

Please sign in to comment.