File: getsharedopensslhasquic.py

package info (click to toggle)
nodejs 22.18.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 252,988 kB
  • sloc: cpp: 1,594,216; javascript: 592,155; ansic: 125,008; python: 60,768; sh: 4,124; makefile: 2,875; asm: 1,732; pascal: 1,565; perl: 248; lisp: 222; xml: 42
file content (23 lines) | stat: -rw-r--r-- 420 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from __future__ import print_function
import os
import re

def get_has_quic(include_path):
  if include_path:
    openssl_quic_h = os.path.join(
        include_path,
        'openssl',
        'quic.h')

    try:
      f = open(openssl_quic_h)
    except OSError:
      return False

    regex = r'^#\s*define OPENSSL_INFO_QUIC'

    for line in f:
      if (re.match(regex, line)):
        return True

  return False