Skip to content

Commit 657f83e

Browse files
committed
Merge branch 'master' into basic_tls_support_2
2 parents e0406e4 + 0d0b499 commit 657f83e

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ codecov = { repository = "jonhoo/msql-srv", branch = "master", service = "github
2727
maintenance = { status = "experimental" }
2828

2929
[dependencies]
30-
nom = "5"
30+
nom = "7"
3131
mysql_common = { version = "0.28.0", features = ["chrono"] }
3232
byteorder = "1"
3333
chrono = "0.4"

src/lib.rs

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -278,17 +278,22 @@ impl<B: MysqlShim<RW>, RW: Read + Write> MysqlIntermediary<B, RW> {
278278
io::ErrorKind::UnexpectedEof,
279279
"client sent incomplete handshake",
280280
),
281-
nom::Err::Failure((input, nom_e_kind))
282-
| nom::Err::Error((input, nom_e_kind)) => {
283-
if let nom::error::ErrorKind::Eof = nom_e_kind {
281+
nom::Err::Failure(nom_error) | nom::Err::Error(nom_error) => {
282+
if let nom::error::ErrorKind::Eof = nom_error.code {
284283
io::Error::new(
285284
io::ErrorKind::UnexpectedEof,
286-
format!("client did not complete handshake; got {:?}", input),
285+
format!(
286+
"client did not complete handshake; got {:?}",
287+
nom_error.input
288+
),
287289
)
288290
} else {
289291
io::Error::new(
290292
io::ErrorKind::InvalidData,
291-
format!("bad client handshake; got {:?} ({:?})", input, nom_e_kind),
293+
format!(
294+
"bad client handshake; got {:?} ({:?})",
295+
nom_error.input, nom_error.code
296+
),
292297
)
293298
}
294299
}
@@ -329,19 +334,21 @@ impl<B: MysqlShim<RW>, RW: Read + Write> MysqlIntermediary<B, RW> {
329334
io::ErrorKind::UnexpectedEof,
330335
"client sent incomplete handshake",
331336
),
332-
nom::Err::Failure((input, nom_e_kind))
333-
| nom::Err::Error((input, nom_e_kind)) => {
334-
if let nom::error::ErrorKind::Eof = nom_e_kind {
337+
nom::Err::Failure(nom_error) | nom::Err::Error(nom_error) => {
338+
if let nom::error::ErrorKind::Eof = nom_error.code {
335339
io::Error::new(
336340
io::ErrorKind::UnexpectedEof,
337-
format!("client did not complete handshake; got {:?}", input),
341+
format!(
342+
"client did not complete handshake; got {:?}",
343+
nom_error.input
344+
),
338345
)
339346
} else {
340347
io::Error::new(
341348
io::ErrorKind::InvalidData,
342349
format!(
343350
"bad client handshake; got {:?} ({:?})",
344-
input, nom_e_kind
351+
nom_error.input, nom_error.code
345352
),
346353
)
347354
}

src/packet.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ fn packet(i: &[u8]) -> nom::IResult<&[u8], (u8, Packet)> {
191191
nom::sequence::pair(
192192
nom::multi::fold_many0(
193193
fullpacket,
194-
(0, None),
194+
|| (0, None),
195195
|(seq, pkt): (_, Option<Packet>), (nseq, p)| {
196196
let pkt = if let Some(mut pkt) = pkt {
197197
assert_eq!(nseq, seq + 1);

0 commit comments

Comments
 (0)